<?php
//判断合法请求
!defined('IAN') && exit('Access Denied');

/* 页面启动类 */
class Init
{
	public function __construct()
	{	
		$this->analyzeURL();
	}
	//解析URL
	private function analyzeURL()
	{
		//判断请求
		if(GET_STR)
		{
			$url= explode('/',GET_STR);
			switch($url[0])
			{
				case 'index':
					$this->indexAction();
						break;
				case 'business':
					$this->businessAction();
						break;
				case 'happy':
					$this->happyAction();
						break;
				case 'show':
					$this->showAction();
						break;
				case 'server':
					$this->serverAction();
						break;
				case 'friend':
					$this->friendAction();
						break;
				case 'partner':
					$this->partnerAction();
						break;
				case 'help':
					$this->helpAction();
						break;
				case 'user':
					$this->userAction();
						break;		
				default:
					$this->errorAction();
						break;																	
			}
		}
		else
		{
			$this->indexAction();
		}
	}
	private function indexAction()
	{	
		require(CTRLS.DS.'index.php');
	}
	private function businessAction()
	{
		require(CTRLS.DS.'business.php');
	}
	private function happyAction()
	{
		require(CTRLS.DS.'happy.php');
	}
	private function showAction()
	{
		require(CTRLS.DS.'show.php');
	}
	private function serverAction()
	{
		require(CTRLS.DS.'server.php');
	}
	private function friendAction()
	{
		require(CTRLS.DS.'friend.php');
	}
	private function partnerAction()
	{
		require(CTRLS.DS.'partner.php');
	}
	private function helpAction()
	{
		require(CTRLS.DS.'help.php');
	}
	private function userAction()
	{
		require(CTRLS.DS.'user.php');
	}
	private function errorAction()
	{
		require(CTRLS.DS.'error.php');
	}
}

$init = new Init();

?>